﻿using SqlSugar;
using Zhp.SqlSugar.Entity;

namespace Zhp.Workflow.Models
{
    public abstract class WorkflowBaseEntity<TEntity, TKey> : BaseEntity<TKey>, IBaseWorkflow where TEntity : BaseEntity<TKey>, new()
    {
        [SugarColumn(IsNullable = true, ColumnDescription = "提交时间")]
        public virtual DateTime? SubmitTime { get; set; }

        [SugarColumn(IsNullable = true, ColumnDescription = "流程提交人ID")]
        public virtual long? SubmitUserId { get; set; }

        [SugarColumn(IsNullable = true, ColumnDescription = "流程提交人名称")]
        public virtual string SubmitNickName { get; set; }

        [SugarColumn(IsNullable = true, ColumnDescription = "流程名称")]
        public virtual string WorkflowName { get; set; }

        [SugarColumn(IsNullable = true, ColumnDescription = "最新流程实例ID")]
        public virtual string WorkflowInstanceId { get; set; }

        [SugarColumn(IsNullable = true, ColumnDescription = "最新审批状态", DefaultValue = "0")]
        public virtual ApproveStatusEnum ApproveStatus { get; set; }

        [SugarColumn(IsNullable = true, ColumnDescription = "最新流程状态", DefaultValue = "0")]
        public virtual WorkflowStatusEnum WorkflowStatus { get; set; }

        [SugarColumn(IsNullable = true, ColumnDescription = "最新流程实例被审批个数,可以根据是否等于0判断是否可以取消流程")]
        public virtual int? ApprovedCount { get; set; }
    }
}
